package scala.collection.change

object ListTest {

  def main(args: Array[String]): Unit = {
    val l1 = List(1, 34, 52, 11, 223)
    //    1.获取集合长度
    println(l1.length)

    //    2.获取集合大小，等同于length
    println(l1.size)

    // 循环遍历
    l1.foreach(println)

    //迭代器
    for (i <- l1.iterator) println(i)

    //生成字符串
    println(l1.mkString(","))

    //是否包含
    println(l1.contains(1))
    println(l1.contains(1999))

  }
}
